import { baseUrlApi, requestClient, type Result } from '#/api/request';
/** 应用列表 */
export const getApps = (params: object) => {
  return requestClient.get<Result>(baseUrlApi('/admin/apps'), { params });
};

/** 更新应用 */
export const putApps = (name: string) => {
  return requestClient.put<Result>(baseUrlApi(`/admin/apps/${name}`));
};

/** 安装应用 */
export const postApps = (name: string) => {
  return requestClient.post<Result>(baseUrlApi(`/admin/apps/${name}`));
};

/** 卸载应用 */
export const deleteApps = (data: {
  confirm_name: string;
  name: string;
  password: string;
}) => {
  return requestClient.delete<Result>(baseUrlApi(`/admin/apps`), data as any);
};
